CC = c++
SUFFIX = .cpp
EXE = ts
SRC = main
COMMON_PATH = ../common/
COMMON_SRC = const config tools network log

.PHONY:all clean

all:$(EXE)

$(EXE):$(foreach N, $(SRC), $N$(SUFFIX)) $(foreach N, $(COMMON_SRC), $N.o)
	$(CC) -Wall -o $@ $^

%.o:$(COMMON_PATH)%$(SUFFIX)
	$(CC) -Wall $^ -c -o $@

clean:
	rm -f *.o $(EXE)